package com.biyao.controller.state;


import com.baomidou.mybatisplus.plugins.Page;
import com.biyao.schedulingcommon.response.BaseMsg;
import com.biyao.schedulingcommon.response.SuccessMsg;
import com.biyao.schedulingentity.state.GrinderMoveToRoller;
import com.biyao.schedulingentity.state.MoveToGrinder;
import com.biyao.schedulingentity.state.RollerMoveEntity;
import com.biyao.schedulingentity.state.TGrindingLogEntity;
import com.biyao.service.model.state.GrindingLogMessage;
import com.biyao.service.model.state.imp.TGrindingLogService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.models.auth.In;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
/**
 * 
 *
 * @author code generator
 * @date 2019-09-16 09:44:18
 */
@Api(tags = {"磨床日志"})
@RestController
@RequestMapping("api/v1/tgrindinglog")
public class TGrindingLogController {

    @Autowired
    private GrindingLogMessage grindingLogMessage;

    @ApiOperation(value = "磨辊移动到磨床")
    @PostMapping("/moveToGrinder")
    public BaseMsg moveToGrinder(@RequestBody MoveToGrinder moveToGrinder){
        grindingLogMessage.moveToGrinder(moveToGrinder);
        return new SuccessMsg();
    }
    @ApiOperation(value = "查询磨削量和当前辊的直径")
    @PostMapping("/selectGrinderState")
    public BaseMsg selectGrinderState(@RequestBody MoveToGrinder moveToGrinder){
        return new SuccessMsg(grindingLogMessage.selectGrinderState(moveToGrinder));
    }
    @ApiOperation(value = "磨床轧辊移动到辊架")
    @PostMapping("/GrinderToRoller")
    public BaseMsg GrinderToRoller(@RequestBody GrinderMoveToRoller grinderMoveToRoller){
        return new SuccessMsg(grindingLogMessage.grinderMoveToRoller(grinderMoveToRoller));
    }

    @ApiOperation(value = "查询轧辊磨床记录时间列表")
    @GetMapping("/selectTGrindLogByRollerId/{rollerId}")
    public BaseMsg selectTGrindLogByRollerId(@PathVariable("rollerId") Integer rollerId){
        return new SuccessMsg(grindingLogMessage.selectGrinderLogById(rollerId));
    }
    @ApiOperation(value = "查询轧辊磨床记录时间详细信息")
    @GetMapping("/selectTGrindLogById/{id}")
    public BaseMsg selectTGrindLogById(@PathVariable("id") Integer id){
        return new SuccessMsg(grindingLogMessage.selectGrinderLogDetailById(id));
    }

    @ApiOperation(value = "查询磨床记录")
    @GetMapping("/selectTGrinderLogByGrinderId/{id}")
    public BaseMsg selectTGrinderLogByGrinderId(@PathVariable("id") Integer grinderId){
         return new SuccessMsg(grindingLogMessage.selectGrinderLogByGrinderId(grinderId));
    }




}
